#!/usr/bin/env python
# coding=utf-8
import base64
from itertools import repeat

b64_str = input("Enter Base64 String: ")
decode_times = int(input("Enter the number of times to decode: "))

for i in repeat(None, decode_times):
    b64_str = base64.b64decode(b64_str)

print(b64_str)
